USE [{WebDatabase}]
GO
/****** Object:  Table [dbo].[Fragment]    Script Date: 10/14/2006 20:07:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Fragment]
(
    [FragmentId]          [int] IDENTITY(1,1) NOT NULL
,   [ClientId]            [varchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
,   [FragmentName]        [varchar](64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
,   [FragmentDisplayName] [varchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
,   [SortOrdinal]         [tinyint] NULL
,   [ItemChar]            [varchar](1024) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
,   [ItemText]            [text] COLLATE SQL_Latin1_General_CP1_CI_AS NULL
,   [CreateDate]          [datetime] NULL
,   [ModificationDate]    [datetime] NULL
,   [EndDate]             [datetime] NULL
,   [DocumentId]          [int] NULL
,   [PrevFragmentId]      [int] NULL
,   [NextFragmentId]      [int] NULL
,   [IsActive]            [bit] NULL
,   [IsPrevious]          [bit] NULL CONSTRAINT [DF_Fragment_isPrevious]  DEFAULT (0)
,   [IsNext]              [bit] NULL CONSTRAINT [DF_Fragment_isNext]  DEFAULT (0)
,   [IsWrapper]           [bit] NULL CONSTRAINT [DF_Fragment_isWrapper]  DEFAULT (0)
,
CONSTRAINT [PkFragment] PRIMARY KEY CLUSTERED([FragmentId] ASC)
WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]

)
ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO

ALTER TABLE [dbo].[Fragment]  WITH NOCHECK ADD  CONSTRAINT [FkFragmentDocument]
FOREIGN KEY([DocumentId])
REFERENCES [dbo].[Document] ([DocumentId])
GO

ALTER TABLE [dbo].[Fragment] NOCHECK CONSTRAINT [FkFragmentDocument]
GO

ALTER TABLE [dbo].[Fragment]  WITH NOCHECK ADD  CONSTRAINT [FkFragmentNextFragment]
FOREIGN KEY([NextFragmentId])
REFERENCES [dbo].[Fragment] ([FragmentId])
GO

ALTER TABLE [dbo].[Fragment] NOCHECK CONSTRAINT [FkFragmentNextFragment]
GO

ALTER TABLE [dbo].[Fragment]  WITH NOCHECK ADD  CONSTRAINT [FkFragmentPrevFragment]
FOREIGN KEY([PrevFragmentId])
REFERENCES [dbo].[Fragment] ([FragmentId])
GO

ALTER TABLE [dbo].[Fragment] NOCHECK CONSTRAINT [FkFragmentPrevFragment]
